finding the greatest common factor of monomials